package cn.cumulomq.utils;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.ibatis.io.Resources;

public class PropertiesUtil {
	public static Properties prop = new Properties();
	static{
		try {
//			Class.class.getResource("cumulomq.properties");
//			System.out.println(":::::"+Resources.getResourceURL("parse_templates/AFTN_FPLS2012.xml").toString());
			InputStream in = Resources.getResourceAsStream("cumulomq.properties");  
			prop.load(in);
//			messageDBPath=prop.getProperty("messagedb.path");
//			
//			messageDBTemplate=prop.getProperty("messagedb.template");
//			messageDBDriver=prop.getProperty("messagedb.driverClassName");
//			messageDBUsername=prop.getProperty("messagedb.username");
//			messageDBPassword=prop.getProperty("messagedb.password");
//			messageDBUrl=prop.getProperty("messagedb.url");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public static String getProperty(String key){
		return prop.getProperty(key);
	}
	
}
